public class CustomAuthProvider implements Auth.AuthProviderPlugin {


   public System.PageReference initiate(Map<String,String> authProviderConfiguration , String stateToPropagate){
   		System.debug(authProviderConfiguration);
   		System.debug(stateToPropagate);

   		return  new PageReference('/'); 
   }
   public  String  getCustomMetadataType(){

   		return 'TestMeta__mdt';
   }


   public Auth.AuthProviderTokenResponse handleCallback(Map<String,String> authProviderConfiguration , Auth.AuthProviderCallbackState callbackState){

   		System.debug(authProviderConfiguration);
   		System.debug(callbackState);
   		return new Auth.AuthProviderTokenResponse('provider','oauthToken','oauthSecretOrRefreshToken','state');
   }


   public Auth.UserData getUserInfo(Map<String,String> authProviderConfiguration, Auth.AuthProviderTokenResponse response){
   		System.debug(authProviderConfiguration);
   		System.debug(response);
   		/*UserData(String userId, String firstName, String lastName, String fullName,
String email, String link, String userName, String locale, String provider, String
siteLoginUrl, Map<String,String> ,)*/
   		return new Auth.UserData('userId','firstName','lastName','fullName','email','link','userName','locale','provider','siteLoginUrl',null);
   }

}